<template>
  <ul>
    <div class='container'>
      <li class='logo' v-on:click='choose=1'>
        <router-link to='/'>VegeTable Study</router-link>
      </li>
      <li v-for='navlink in navlinks' v-bind:class='{ Active: navlink.id == choose }' v-on:click='choose=navlink.id'>
        <router-link :to='navlink.link'>{{ navlink.name }}</router-link>
      </li>
    </div>
  </ul>
</template>

<script>
export default {
  name: 'Nav',
  data () {
    return {
      msg: '2333',
      choose: 1,
      navlinks: [{
        id: 1,
        name: '课表详情',
        link: '/'
      },
      {
        id: 2,
        name: '作业详情',
        link: '/homework'
      },
      {
        id: 3,
        name: '关于项目',
        link: '/about'
      }]
    }
  }
}
</script>

<style>
a, a:hover, a:visited {
    color: #000;
}

ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: rgba(0, 0, 0, .9);
    position: fixed;
    top: 0;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .2);
    z-index: 1000;
}

li {
    float: left;
    border-top: 3px solid transparent;
    transition-timing-function: cubic-bezier(.215,.61,.355,1);
}

li a {
    display: block;
    color: #555;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none !important;
    transition: all 0.2s;
}

li.logo {
    font-weight: 700;
}

li:hover:not(.logo) {
    background-color: #fcfcfc;
    border-color: #9ae3f3;
}

li:hover::before {
    display: none;
}

li.Active {
    border-color: #ed5f82;
    position: relative;
}

li.Active::before {
    content: '';
    position: absolute;
    left:0;
    top:-1px;
    width:100%;
    height:1px;
    box-shadow: 0 0 30px #ed5f82, 0 0 30px #ed5f82;
}
</style>
